	<? 
				echo '<div id="mydialog1">';
				echo '
					<div class="dialog_input" >';
					$form=$this->beginWidget('CActiveForm', array(
						'id'=>'category-form',
						'enableAjaxValidation'=>true,
					)); 
				echo '
					<div>
					<label>Наименование</label>';
					echo $form->textField($model, 'title', array('class'=>'medium', 'id'=>'item-name-input'));
					echo $form->error($model,'title'); 
					
					echo '
					</div>
					<div>
					    <label>Раздел</label><div style="clear:both;"></div>
					    <div style="display: inline-block;">
					';	

					if (isset(Yii::app()->controller->category)) $category = Yii::app()->controller->category;
					else $category = array();
					
					$row =array();
					$row['label'] = Yii::t('app','Главная');
					$row['text'] = Yii::t('app','Главная');  
					$row['id'] = '0';
					$row['url'] = '';
					$row['children'] = array(); 
					$row['items'] = array();     

					$category = array_pad($category, -(count($category) + 1), $row);
					$this->widget('application.extensions.mcdropdown.McDropdown',array(
							                'model'=>$model,
							                'attribute'=>'parent_id',
							                'form'=>$form,
							                'data' => $category,
							                ));
					echo '	
					  </div>			    			
					  </div>';
					echo '
						<div>
						<label>Сортировка</label>
						<div style="clear:both;"></div>
						';
						echo $form->textField($model, 'sort', array('class'=>'small', 'id'=>'item-name-input'));
						echo $form->error($model,'sort');
					echo '</div>'	; 
					
					$this->endWidget();
					echo '
					</div>
					</div>';
	?>
